<template>
    <div class="user">
        <div class="user-info">
            <div class="avatar"><img :src="userInfo.img" alt=""></div>
            <div class="text">
                <div class="username">
                    {{ userInfo.userName }}
                    <span class="level bg-yellow">LV{{userInfo.level}}</span>
                </div>
                <div class="post">
                    <span class="iconfont icon-ziliao"></span>
                    <span>{{ userInfo.position }}</span>
                </div>
                <div class="introduce">
                    <span class="iconfont icon-faxian"></span>
                    <span>{{ userInfo.motto }}</span>
                </div>
            </div>
            <div class="fans-group">
                <div class="item" v-for="(item,index) in fansGroup" :key="index">
                    <div class="name">{{item.label}}</div>
                    <div class="value">{{item.value}}</div>

                </div>
            </div>
            <div class="button-group">
                <el-button @click="goBlog" class="btn">写博客</el-button>
                <el-button @click="goDraftList" class="btn">草稿箱</el-button>
            </div>
        </div>

    </div>
</template>

<script>
    export default {
        data() {
            return {
                hoverIndex: "",
                animate:false
            };
        },
        props: {
            userInfo: {
                type: Object,
                default: ()=>{
                    return {}
                }
            },
            fansGroup: {
                type: Array,
                default: ()=>{
                    return []
                }
            }

        },
        methods: {
            goBlog() {
                this.$router.push({path: 'blog'})
            },
            goDraftList() {
                this.$router.push({path: 'draftList'})
            },
        }
    };
</script>

<style scoped lang="scss">
    .user {
        background:#fff;
        width: 100%;
        max-width: 100%;
		height: 160rem;
        .user-info {
            display: flex;
            align-items: center;
            padding: 30rem 0rem;
            justify-content: space-between;
            .avatar {
                width: 90rem;
                height: 90rem;
                font-size: 0;
                margin-right: 30rem;
                img {
                    width: 100%;
                    height: 100%
                }
            }
            .username {
                color: #333;
                font-weight: 600;
                font-size: 28rem;
                line-height: 1;
                position: relative;
                .level {
                    position: relative;
                    right: -4rem;
                    top: -10rem;
                    font-size: 12rem;
                    color: #fff;
                    padding: 1rem 2rem;
                    border-radius: 1rem;
                    font-weight: 400;
                }
            }
            .post {
                font-size: 14rem;
                margin-top:14rem;
                display: flex;
                align-items: center;
                color: #666;
                .iconfont {
                    vertical-align: middle;
                    margin-right: 4rem;
                    position: relative;
                    top: 1rem;
                }
            }
            .introduce {
                display: flex;
                align-items: center;
                font-size: 12rem;
                margin-top: 0rem;
                .iconfont {
                    vertical-align: middle;
                    margin-right: 4rem;
                    position: relative;
                    top: 1rem;
                }
            }
            .fans-group {
                width: 400rem;
                display: flex;
                .item {
                    flex:1;
                    display: flex;
                    flex-direction: column;
                }
            }
            .button-group {
                width: 68px;
                .btn {
                    margin-left:0;
                }
                .btn:last-child {
                    margin-top: 20rem;
                    margin-left:0;
                }
            }
        }

    }
</style>
